package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author lwj
 * @date 2025/5/26
 */
    
@Data
@TableName(value = "t_pay_record")
public class PayRecord {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 用户第三方id
     */
    @TableField(value = "user_open_id")
    private String userOpenId;

    /**
     * 订单id
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 微信侧订单号
     */
    @TableField(value = "wx_out_trade_no")
    private String wxOutTradeNo;

    /**
     * 支付金额，单位分
     */
    @TableField(value = "pay_fee")
    private Long payFee;

    /**
     * 0:wx支付，1：幺币支付
     */
    @TableField(value = "pay_type")
    private Integer payType;

    /**
     * 微信侧 支付id
     */
    @TableField(value = "wx_prepay_id")
    private String wxPrepayId;

    /**
     * 0，待支付，1：支付中，2：支付成功，3: 支付失败
     */
    @TableField(value = "pay_status")
    private Integer payStatus;

    /**
     * 支付失败原因
     */
    @TableField(value = "fail_remark")
    private String failRemark;

    /**
     * 待支付时间
     */
    @TableField(value = "pay_start_time")
    private LocalDateTime payStartTime;

    /**
     * 支付中时间
     */
    @TableField(value = "paying_time")
    private LocalDateTime payingTime;

    /**
     * 支付成功时间
     */
    @TableField(value = "pay_success_time")
    private LocalDateTime paySuccessTime;

    /**
     * 支付失败时间
     */
    @TableField(value = "pay_fail_time")
    private LocalDateTime payFailTime;

    /**
     * 是否异常
     */
    @TableField(value = "is_exception")
    private Integer isException;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time", update = "now()")
    private LocalDateTime updateTime;
}